package iconSwingStates.Event;

import java.awt.Point;
import java.awt.geom.Point2D;
import java.util.ArrayList;
/**
 * Extending {@link EVirtualIConEvent}, this class adds two doubles to represents the X and Y positions of the pointer
 * @author uribe - gaget
 *
 */
public class EVirtualConPositionEvent extends EVirtualIConEvent {
	private static final long serialVersionUID = 1L;
	/**
	 * The position
	 */
	private double x,y;
	
	/**
	 * Constructor for a position event with values
	 * @param name Name of the event
	 * @param x The X value
	 * @param y The Y value
	 * @param values The slots values
	 */
	public EVirtualConPositionEvent(String name, double x, double y, ArrayList<Object> values) {
		super(name,values);
		this.x = x;
		this.y = y;
	}
	
	/**
	 * Constructor for a position event without values
	 * @param name Name of the event
	 * @param x The X value
	 * @param y The Y value
	 */
	public EVirtualConPositionEvent(String name, double x, double y) {
		super(name);
		this.x = x;
		this.y = y;
	}
	
	/**
	 * Constructor for a position event with values
	 * @param name Name of the event
	 * @param p The position
	 * @param values The slots values
	 */
	public EVirtualConPositionEvent(String name, Point p, ArrayList<Object> values) {
		super(name,values);
		this.x = p.getX();
		this.y = p.getY();
	}
	
	/**
	 * Constructor for a position event without values
	 * @param name Name of the event
	 * @param p the position
	 */
	public EVirtualConPositionEvent(String name, Point p) {
		super(name);
		this.x = p.getX();
		this.y = p.getY();
	}
	/**
	 * This method returns the positions within a Point object
	 * @return a point with x and y values
	 */
	public Point2D.Double getPoint(){
		Point2D.Double p = new Point2D.Double(x,y);
		return p;
	}
	/**
	 * Returns the x value
	 * @return x
	 */
	public double getX(){
		return x;
	}
	/**
	 * Returns the y value
	 * @return y
	 */
	public double getY(){
		return y;
	}
}

